package com.corecloud.controller.sys;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.corecloud.entity.SchoolNature;
import com.corecloud.service.SchoolNatureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/nature")
public class SchoolNatureController {
    @Autowired
    private SchoolNatureService natureService;
    @GetMapping("/all/{schoolType}")
    public List<SchoolNature> getAll(@PathVariable("schoolType")Integer schoolType){
        List<SchoolNature> list = natureService.list(new QueryWrapper<SchoolNature>().eq("school_type", schoolType));
        return list;
    }
}
